package com.csii.mobilebanking.expandablelistview.fragment;

import com.csii.mobilebanking.R;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.RadioGroup;


/**
 * CustomerInformationManagementFragment 客户信息管理
 * 
 * @author hua
 * 
 */
@SuppressLint("Recycle")
public class CustomerFPFragment extends BaseFragment implements OnClickListener {
	private static final String MAIN_ACTIVITY = "CustomerIMtFragment";
	private Button btn_query,btn_planniing_create,btn_cfp_submit,btn_cfp_affirm;
	
	
	@SuppressWarnings("static-access")
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		Log.d(MAIN_ACTIVITY, "onCreateView_CustomerIMtFragment--"
				+ this.getArguments().getInt("index"));
		// 初始化系列
		initView(inflater, R.array.title_cfp, R.array.title_cfp_tag,
				R.array.title_cfp_ids, R.array.title_cfp_layout,
				R.array.tab_cfp_view_ids);
		if (container == null)
			return null;

		
		tabHost.inflate(getActivity(), R.layout.planning_assessmen_info, tabHost.getTabContentView());
		tabHost.inflate(getActivity(), R.layout.planning_assessmen_create, tabHost.getTabContentView());
		tabHost.inflate(getActivity(), R.layout.planning_assessmen_affirm, tabHost.getTabContentView());
		tabHost.addTab(tabHost.newTabSpec("3").setContent(R.id.tab_cfp_view_assessment_info).setIndicator("3"));
		tabHost.addTab(tabHost.newTabSpec("4").setContent(R.id.tab_cfp_view_assessment_create).setIndicator("4"));
		tabHost.addTab(tabHost.newTabSpec("5").setContent(R.id.tab_cfp_view_assessment_affirm).setIndicator("5"));
		//查询
		btn_query = (Button) tabHost.findViewById(R.id.btn_query);
		btn_query.setOnClickListener(this);
		btn_planniing_create=(Button) tabHost.findViewById(R.id.btn_planniing_create);
		btn_planniing_create.setOnClickListener(this);
		btn_cfp_submit=(Button) tabHost.findViewById(R.id.btn_cfp_submit);
		btn_cfp_submit.setOnClickListener(this);
		btn_cfp_affirm=(Button) tabHost.findViewById(R.id.btn_cfp_affirm);
		
		
		return tabHost;
	}

	/***
	 * title 菜单
	 */
	@Override
	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
		super.onCreateOptionsMenu(menu, inflater);

	}

	/***
	 * 点选按钮监听事件
	 */
	@Override
	public void onCheckedChanged(RadioGroup group, int checkedId) {
		Log.d(MAIN_ACTIVITY, "checkedId..." + checkedId);
		switch (checkedId) {
		case R.id.rbtn_title_cfp_assessment:
			tabHost.setCurrentTab(0);
			break;
		case R.id.rbtn_title_cfp_suggestions:
			tabHost.setCurrentTab(1);
			break;
		case R.id.rbtn_title_cfp_service:
			tabHost.setCurrentTab(2);
			break;

		}
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.btn_query:
				//查询
				tabHost.setCurrentTab(3);
				break;
			case R.id.btn_planniing_create:
				//新增
				tabHost.setCurrentTab(4);
				break;
			case R.id.btn_cfp_submit:
				//提交
				tabHost.setCurrentTab(5);
				break;
			case R.id.btn_cfp_affirm:
				//确认
				tabHost.setCurrentTab(0);
				break;
		}

	}
	
	

}